<%--
  User: huoshanwei
  Date: 13-12-17
  Time: 上午10:51
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/tags/taglibs.jsp" %>
<html>
<head>
    <title>每日一词信息</title>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:false" style="padding:5px;background:#fff;border:1px solid #ccc;">
        <table class="doc-table">
            <tr>
                <th width="20%"></th>
                <th width="80%"></th>
            </tr>
            <tr>
                <td class="labelTd">
                    单词ID
                </td>
                <td>
                    ${wordQuery.wordId}
                </td>
            </tr>
            <tr>
                <td class="labelTd">
                    标题
                </td>
                <td>
                    ${wordQuery.wordTitle}
                </td>
            </tr>
            <tr>
                <td class="labelTd">
                    关键词
                </td>
                <td>
                    ${wordQuery.keyWord}
                </td>
            </tr>
            <tr>
                <td class="labelTd">图片</td>
                <td>
                    <img src="${wordQuery.imagePath}" height="160" width="160">
                </td>
            </tr>
            <%--<tr>
                <td class="labelTd">
                    评论
                </td>
                <td>
                    ${wordQuery.remark}
                </td>
            </tr>--%>
            <tr>
                <td class="labelTd">
                    状态
                </td>
                <td>
                    ${wordQuery.stateName}
                </td>
            </tr>
            <tr>
                <td class="labelTd">
                    内容
                </td>
                <td>
                    <script id="myEditor" type="text/plain"
                            style="width:690px;height:300px;">${wordQuery.content}</script>
                </td>
            </tr>
            <tr>
                <td class="labelTd">创建时间</td>
                <td>
                    <fmt:formatDate value="${wordQuery.createTime}" type="both"/>
                </td>
            </tr>
            <tr>
                <td class="labelTd">更新时间</td>
                <td>
                    <fmt:formatDate value="${wordQuery.updateTime}" type="both"/>
                </td>
            </tr>
        </table>
    </div>
    <div data-options="region:'south',border:false" style="text-align:right;padding:5px 0;">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" style="margin-right: 15px;"
           href="javascript:void(0)" onclick="closeUM();">关闭</a>
    </div>
</div>
<script type="text/javascript">
    //实例化编辑器
    var um = UM.getEditor('myEditor');
    um.addListener('blur', function () {
        $('#focush2').html('编辑器失去焦点了')
    });
    um.addListener('focus', function () {
        $('#focush2').html('')
    });

    function hasContent() {
        var text = UM.getEditor('myEditor').hasContents();
        if (text == false) {
            alert("请先填写内容！");
            return;
        }
        var content = UM.getEditor('myEditor').getContent();
        $('#content').val(content);
        insertSubmit();
    }

    function setFocus() {
        UM.getEditor('myEditor').focus();
    }

    function deleteEditor() {
        disableBtn();
        UM.getEditor('myEditor').destroy();
    }

    function disableBtn(str) {
        var div = document.getElementById('btns');
        var btns = domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            if (btn.id == str) {
                domUtils.removeAttributes(btn, ["disabled"]);
            } else {
                btn.setAttribute("disabled", "true");
            }
        }
    }

    function enableBtn() {
        var div = document.getElementById('btns');
        var btns = domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            domUtils.removeAttributes(btn, ["disabled"]);
        }
    }

    /*   function getContentTxt() {
     var content = UM.getEditor('myEditor').getContentTxt();
     UM.getEditor('myEditor').setContent(content);
     }
     */
    jQuery(function ($) {
        $(".panel-tool-close").on('click', function () {
            closeUM();
        });
    });
    function closeUM() {
        // 关闭Dialog前移除编辑器
        UM.getEditor('myEditor').destroy();
        closeWindow()
    }
</script>
</body>
</html>
